home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / TPWENG / PSWADD.PAS < prev    next >
Pascal/Delphi Source File  |  1991-07-22  |  542b  |  29 lines

  1. program PswAdd;
  2. uses PXEngine, WinCrt, WinTypes;
  3.  
  4. const TableName = 'Table';
  5.       Password  = 'Password';
  6.  
  7. var   PxErr: Integer;
  8.       Protected: Bool;
  9.  
  10. procedure PX(Code : integer);
  11. begin
  12.   writeln(PXErrMsg(Code));
  13. end;
  14.  
  15. begin
  16.   PX(PXWinInit('MyApp', pxShared));
  17.   PX(PXTblProtected(TableName, Protected));
  18.  
  19.   if Protected then
  20.   begin
  21.     (* Submit password to system if table protected *)
  22.     PxErr := PXPswAdd(Password);
  23.     if PxErr <> PxSuccess
  24.     then Writeln(PxErrMsg(PxErr));
  25.   end;
  26.  
  27.   PX(PXExit);
  28. end.
  29.